package com.jrzh.mvc.convert.sys;

import com.jrzh.common.exception.ProjectException;
import com.jrzh.common.utils.DateUtil;
import com.jrzh.common.utils.ReflectUtils;
import com.jrzh.framework.base.convert.BaseConvertI;
import com.jrzh.mvc.model.sys.UserEventModel;
import com.jrzh.mvc.view.sys.UserEventView;

public class UserEventConvert implements BaseConvertI<UserEventModel, UserEventView>{

	public UserEventModel addConvert(UserEventView view) throws ProjectException {
		return null;
	}

	public UserEventModel editConvert(UserEventView view, UserEventModel model) throws ProjectException {
		return null;
	}

	public UserEventView convertToView(UserEventModel model) throws ProjectException {
		UserEventView view = new UserEventView();
		ReflectUtils.copySameFieldToTarget(model, view);
		view.setUserName(model.getCreateBy());
		view.setTime(DateUtil.format(model.getTime()));
		return view;
	}

}
